<?php
/*
 * @Created by: wangchengcheng
 * @Author: wangchengcheng
 * @Date: 2020-01-05 18:35:25
 * @LastEditors  : wangchengcheng
 * @LastEditTime : 2020-01-05 18:37:29
 */

namespace App\Http\Middleware;

use Closure;


class AuthenticateWithSocialiteGuard
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(!auth()->guard('socialite')->check()){
            return response('请选登录', 401);
        }
        
        return $next($request);
    }
}
